
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'room-form',
	'enableAjaxValidation'=>false,
	'enableClientValidation'=>true,
		//'enableClientValidation'=>True,
	'clientOptions'=>array("validateOnSubmit"=>True),
)); ?>
						<p class="note"><span class="required">*</span> 为必填写字段.</p>
					
						<?php echo $form->errorSummary($model); ?>
							
							<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
								
								<p>
										<?php echo $form->labelEx($model,'RoomName'); ?>
										<?php echo $form->textField($model,'RoomName',array('size'=>60,'maxlength'=>100,'class'=>'text-input small-input')); ?>
										<?php echo $form->error($model,'RoomName'); ?>
								</p>
								<p>
										<?php echo $form->labelEx($model,'RoomFirstName'); ?>
										<?php echo $form->textField($model,'RoomFirstName',array('size'=>60,'maxlength'=>100,'class'=>'text-input small-input')); ?>
										<?php echo $form->error($model,'RoomFirstName'); ?>
								</p>
								<p>
										<?php echo $form->labelEx($model,'Introduce'); ?>
										<?php echo $form->textField($model,'Introduce',array('size'=>100,'maxlength'=>100,'class'=>'text-input medium-input')); ?>
										<?php echo $form->error($model,'Introduce'); ?>
								</p>
								<p>
									<?php echo $form->labelEx($model,'RoomType'); ?>
									<?php echo $form->dropDownList($model,"RoomType",array("0"=>"系统房间","1"=>"用户房间"),array("class"=>"small-input"));?>
								</p>
								<p>
										<?php echo $form->labelEx($model,'UpLimit'); ?>
										<?php echo $form->textField($model,'UpLimit',array('size'=>5,'maxlength'=>10,'class'=>'text-input small-input')); ?>
										<?php echo $form->error($model,'UpLimit'); ?>
								</p>
								<p>
										<div>
										<?php echo $form->labelEx($model,'Creator'); ?>
										<span class="roomCreator"><?php echo (isset($model->roomowner->UserName))?$model->roomowner->UserName:Yii::app()->params["SystemUser"];?></span>
										<?php echo CHtml::link("选择创建人", "javascript:;",
												array(
															"onclick"=>'$("#mydialog").dialog("open"); return false;',
													)									
												);?>
										<?php echo $form->hiddenField($model,"Creator");?>
										<?php echo $form->error($model,'Creator'); ?>
										</div>

								</p>
								<p>
									<?php echo $form->labelEx($model,'RoomPri'); ?>
									<?php echo $form->dropDownList($model,"RoomPri",array("0"=>"系统房间","1"=>"用户房间"),array("empty"=>"请选择","class"=>"small-input"));?>
								</p>	
								<p>
										<?php echo $form->labelEx($model,'Commend'); ?>
										<?php echo $form->textField($model,'Commend',array('size'=>5,'maxlength'=>10,'class'=>'text-input small-input')); ?>
										<?php echo $form->error($model,'Commend'); ?>
								</p>		
								<p>
										<?php echo $form->labelEx($model,'RoomIsShow'); ?>
										<?php echo $form->checkBox($model,'RoomIsShow'); ?>展现
										<?php echo $form->error($model,'RoomIsShow'); ?>
								</p>		
								<p>
									<input class="button" type="submit" value="Submit" />
								</p>
								
							</fieldset>
							
							<div class="clear"></div><!-- End .clear -->
							
<?php $this->endWidget(); ?>
<?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
		'id'=>'mydialog',
		// additional javascript options for the dialog plugin
		'options'=>array(
				'title'=>'选择用户',
				'autoOpen'=>false,
				'width'=>600,
				"height"=>350,
				"modal"=>false,
		),
));

?>
<iframe src="<?php echo $this->createUrl("user/list",array("parentId"=>"roomCreator","parentHiddenId"=>"Room_Creator"))?>"
   width="400" frameborder="0" style="width:100%;height:280px;">
</iframe>
<?php 
$this->endWidget('zii.widgets.jui.CJuiDialog');

?>

